<?php
/**
 * 编辑功能
 *
 *
 **/
//获取管理员数据
$adminId=$_POST['admin_id'];
$adminEmail=$_POST['admin_email'];
$adminName= $_POST['admin_name'];
$adminPassword= $_POST['admin_password'];

//保存到数据库
date_default_timezone_set("PRC");

$dsn="mysql:Server=127.0.0.1;dbname=blog";
$db= new PDO($dsn, "root", "123456");
$db ->exec("set names utf8mb4");

$addTime =time();
$updateTime =$addTime;

$sql ="update admin set admin_id='$adminId',admin_email='$adminEmail',admin_name='$adminName',admin_password='admin_password',update_time='$updateTime' 
        where admin_id='$adminId'";
$result =$db->exec($sql);

if($result){
    echo "修改成功。<a href='admin_list.php'>返回列表页面</a>";
    exit();
}else{
    echo "修改失败，错误信息。请联系管理人员：1974289078@qq.com";
}